<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: huajie <banhuajie@163.com>
// +----------------------------------------------------------------------

namespace Api\Controller;
use Think\Controller;

class ProductController extends Controller {


    public function index(){
        //$this->json();
        header('Content-type:text/json;charset=utf-8');
        $map['spu'] = $_REQUEST['spu'];

//        header('Content-type: application/json');
//        $data = M('product')->getField('name');
//        header('Content-type:text/json');
        $data = M('product')->where($map)->select();
        echo json_encode($data);
//        echo $data;
    }

}
